<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/WEB-INF/views/commons/commons.jsp" %>
    <script src="/static/js/system/expend.js"></script>
</head>
<body>
<table id="expend_datagrid"></table>
<%--<link rel="stylesheet" href="/static/css/expend.css">--%>

<div id="expend_toolbar">
    <a class="easyui-linkbutton" iconCls="icon-add" plain="true" data-cmd="add">新增主分类</a>
    <a class="easyui-linkbutton" iconCls="icon-reload" plain="true" data-cmd="reload">刷新</a>
</div>

<table id="expendPoint" class="t_expendPoint" align="left" border="1" bordercolor="#a0c6e5" style="border-collapse:collapse;">
    <c:forEach var="expend" items="${expends}">
        <tr>
            <td width="15%">
                <div class="parentpoint" style="width: 150px;"><a>${expend.name}</a>
                    <a class="i" plain="true" onclick="delete1(this)" id=${expend.id}><input style="background-color: #ff8080" type="button" value="删除" align="right"></a>
                </div>
            </td>
            <c:forEach var="expendPoint" items="${expend.children}">
                <td>
                    <div class="cildrenpoint">
                        <div class="point"><a>${expendPoint.name}</a>
                            <a class="i" plain="true" onclick="delete1(this)" id="${expendPoint.id}"><input style="background-color: #ff8080" type="button" value="删除"></a>
                        </div>
                    </div>
                </td>
            </c:forEach>
            <td>
                <div class="point" style="width:10px; height: 20px; background:none;border: none;">
                    <a class="i" id="${expend.id}" onclick="addpoint(this)"><input type="button" style="background-color: #a4e9c1" value="增加"></a>
                </div>
            </td>
        </tr>
    </c:forEach>
</table>


<%--添加分类弹框--%>
<div id="expend_dialog">
    <form id="expend_form" method="post">
        <input type="hidden" name="id">
        <table align="center" style="margin-top: 20px">
            <tr><h2 align="center">输入分类</h2></tr>
            <tr>
                <td>支出分类:</td>
                <td>
                    <input id="expendText" type="text" class="easyui-textbox" name="text" data-options="required:true"
                           style="padding-left:10px;width: 175px;">
                </td>
            </tr>
            <div id="expend_btns">
                <a class="easyui-linkbutton" iconCls="icon-save" plain="true" data-cmd="save">保存</a>
                <a class="easyui-linkbutton" iconCls="icon-cancel" plain="true" data-cmd="cancel">取消</a>
            </div>
        </table>
    </form>
</div>

<%--添加子分类弹框--%>
<div id="expend_point_dialog">
    <form id="expend_form_piont" method="post">
        <input type="hidden" name="id">
        <table align="center" style="margin-top: 20px">
            <tr><h2 align="center">输入子分类</h2></tr>
            <tr>
                <td>支出子分类:</td>
                <td>
                    <input id="expendPointText" type="text" class="easyui-textbox" name="text"
                           data-options="required:true"
                           style="padding-left:10px;width: 175px;">
                    <%--父分类ID--%>
                    <input id="parent_id" type="hidden" name="parent.id">
                </td>
            </tr>
            <div id="expendpoint_btns">
                <a class="easyui-linkbutton" iconCls="icon-save" plain="true" data-cmd="point_save">保存</a>
                <a class="easyui-linkbutton" iconCls="icon-cancel" plain="true" data-cmd="point_cancel">取消</a>
            </div>
        </table>
    </form>
</div>

</body>
</html>
